<template> 
    <div class="app-container">
        <div class="ces-main">
          <div ref="headRef">
          <el-row>
    <el-col :span="18"><div class="grid-content bg-purple"></div><Search-Form 
            ref="form"
            size='mini'
            labelWidth = '50px' 
            align="left"
            :searchData = 'Search'
             :tableCols = 'tableCols'
            :searchHandle="searchHandle"
            @handleEnter="refresh"></Search-Form ></el-col>
    <el-col :span="6"><div class="grid-content bg-purple-light">
      <v-GetToolBar align="right" :key="MenuCode" :MenuCode='MenuCode'  
            :IsfunEdit='IsfunEdit'
            :Isfunfail='Isfunfail'
            :Isdelete='true'
            @handeAdd='FunrRowsAdd'
            @handleEdit='handleEdit'
            @OpenFindForm='getDataList'
            @handlexportData='handlexportData'
            @IsfunEdit='handleIsfunEdit'
            @IsfunDelete='handleIsfunfail'
              @handleclose='handleclose'
              @handedelete="delData"
              @handesave="handleAllSave"
            ></v-GetToolBar>
      
          </div></el-col>
  </el-row>
  <!-- <el-row>

<el-button size="mini" icon='el-icon-check' @click="handleAllSave">保存</el-button>
<el-button size="mini" icon="el-icon-delete" @click="delData">删除</el-button>
<el-button size="mini" icon="el-icon-plus" @click="FunrRowsAdd">增行</el-button>
<el-button size="mini" icon="el-icon-document-copy" @click="FunCopyRowsAdd">复制行</el-button>
<el-button size="mini" icon="el-icon-document-copy" @click="FunCopyRowsAddOne">复制</el-button>
</el-row> -->
  </div>
  
        
  <ces-table size='mini' :isSelection='false' :isIndex='true' :isSearch='true' :isHandle='false' :StepSN='0' :ToolBarheight='ToolBarheight'
        :IsfunEdit='IsfunEdit' :Isfunfail='Isfunfail' :tableData='tableData' :tableColumns='tableCols'
        :pagination='Search' @refresh="refresh" @handleEdit='handleEdit' @handleDelete='delData'
        :tableLoading="tableLoading[0]" @workbookInitialized="workbookInitialized" @selectChanged="selectChanged"
        :remark="0" :sysID="0">
      </ces-table>
        
        
          
         
      
    
           
            </div>
    
     <!--搜索弹框-->
        <el-dialog
          title="搜索"
          :visible.sync="SearchDialog"
          custom-class="dialogClass"
          class="searchDialog"
          center
          ref="searchDialog"
          :modal="false"
          :close-on-click-modal="true"
        >
          <el-form :model="Search" label-width="90px" ref="searchForm">
           
           <Search-Form
           :frame="true" 
            ref="form"
            size='mini'
            labelWidth = '50px' 
            :searchData = 'Search'
             :tableCols = 'tableCols'
            :searchHandle="searchHandle"
            @handleEnter="refresh"></Search-Form >
          </el-form>
          <div
            slot="footer"
            :style="{ 'margin-buttom': 0 == 0 ? DialogBtnMargin : DialogBtnMargin }"
          >
            <el-button @click="reform()">重置</el-button>
            <el-button type="primary" @click="refresh()">确 定</el-button>
          </div>
        </el-dialog>
  
  
        <el-dialog
      v-if="dialogVisible"
      :visible.sync="dialogVisible"
      width="800px"
      top="20px"
       
    >
  <el-form :model="name" label-width="80px"  label-position="right">
   <el-tabs type="border-card">
        <el-tab-pane label="">
      <el-form :model="FormData" label-width="90px" ref="MianForm">
       <Mian-Form 
        ref="form"
        :billIDName='billIDName' 
        labelWidth = '100px' 
        :FormData = 'FormData'
        :tableCols = 'tableCols'
        :StepSN = '0'
        :searchHandle="searchHandle"></Mian-Form >
      </el-form>
        </el-tab-pane>
  <div style="float:right ">
  
  <el-button type="primary" @click="handleOpenClose()">关闭</el-button>
        <el-button type="primary" @click="handleSave()">保存</el-button>
  
  </div>
       
  </el-tabs>
      
  </el-form>
     
    </el-dialog>
    
    
    </div>
    </template>
    
    <script>
    
    
    //引入组件
    var _this;
const GCsheets = GC.Spread.Sheets;
import '@grapecity/spread-sheets-vue';
import GC from '@grapecity/spread-sheets';
import '@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css';
import '@grapecity/spread-sheets/js/zh.js';
import { mapState } from 'vuex';
GC.Spread.Common.CultureManager.culture('zh-cn');
import cesTable from "../Common//ComSpreadTable.vue";
import { HeaderCheckBoxCellType } from '@/static/data.js';

   // import cesTable from "../Common//ComVxeTable.vue";
    import SearchForm from "../Common//Search.vue";
    import MianForm from "../Common//form.vue";
    import { funDownload, GetTableColsData, SaveData } from "@/api/Common";
    import { DeleteForm,CloseForm,UpdateForm,getfunDownload } from '@/api/CommonPage/CommonPage'; //更改
    import { getDataList} from '@/api/APSscheduling/APS';
    import vGetToolBar from "../Common/GetToolBar";
    import a from 'file-saver';
import { forEach } from 'jszip/lib/object';
    export default {
      name:"CommonPageVxe",
        data(){
             //表单查询一般分为input，下拉框，和日期，下面是下拉框时的设置下拉信息的情况，我的项目没有用到，但是留着方便看
          
            return {
            MenuCode: "",
            tableData:[],//表格数据
            tableCols:[],//表格列数据
            FormData:[],//表格数据
            searchHandle:[],
            billID:"",
            billIDName:"",
            IsfunEdit:false,
            Isfunfail:false,
            IsFieldText:0,
            StepSN:"0",
            Search: {
            // 查询条件
            total: 0, // 总记录数
            pageSize: 100, // 一页显示的记录数
            page: 1, // /当前页码
            RNO: "006", // 表编号  根据Controller中对应的表编号 //更改
            InterID:"1578",
            jsWhere: "", // 自定义条件
            Download:"",
            
            // Status: 0,
            //   BillState: "BillStateALL",
           
          }, tableLoading: [false, false, false, false],
      spread: [[], [], []],
      selectionData: [[], [], []],
      Indexs: null,
          ToolBarheight:180,
           cities: [
              {
              value: "ALL",
              label: "ALL",
            },
            {
              value: "0",
              label: "草稿",
            },
            {
              value: "1",
              label: "审核中",
            },
            {
              value: "2",
              label: "结案",
            },
            {
              value: "3",
              label: "作废",
            },
          ],  BillStatecities: [
              {
              value: "BillStateALL",
              label: "ALL",
            },
            {
              value: "0",
              label: "未完成",
            },
            {
              value: "2",
              label: "已完成",
            }],
           SearchDialog: false,
             DialogBtnMargin: 0,
             dialogVisible: false,
             SearchDialog: false,
      selectedRowIndexSave: [],
      bit: true,
              
            }
        },
    
       components:{ //引入组件后注册组件
        cesTable, 
         vGetToolBar,
         SearchForm,
         MianForm
       }, created() {
      
       },
       mounted(){
        
       
 
        this.InterID = this.$route.query.InterID.replace("Page","");
        var InterData=this.InterID.split('-');
        this.InterID=InterData[1];
        this.MenuCode=InterData[0];
        this.Search.InterID=this.InterID;
          this.Search.RNO=this.InterID;
     
         
        
         
        this.getDataList()
       
       },
        methods:{
             //搜索重置
        refresh() {
          this.getDataList();
        }, workbookInitialized: function (workbook, remarkTb) {

this.spread[remarkTb] = workbook;
},
         reform() {
           this.Search = {
            // 查询条件
            // total: 0, // 总记录数
            pageSize: 13, // 一页显示的记录数
            page: 1, // /当前页码
            RNO: "006", // 表编号  根据Controller中对应的表编号 //更改
            InterID:"1578",
            jsWhere: "", // 自定义条件
            Download:"",
            IsFieldText:'0'
            //   Status: 0,
            //   BillState: "BillStateALL",
          };
          this.Search.InterID=this.InterID;
          this.Search.RNO=this.InterID;
           this.getDataList();
        },
            async getDataList() {
             
             
            
            const res = await getDataList({ data: JSON.stringify(this.Search) });
            
            // this.tableCols=[];
          debugger
  
  
    //加载列头数据
  if(res.IsFieldText=='0')
  {
    this.tableCols=res.data1;
    this.Search.IsFieldText='1'//已加载数据，不再加载
  if(this.Isfunfail==true)
  {
    let row = {
        prop: 'isChecked',
        label: '选择',
        width: 80,
        IsWrite: 1,
        WFStepSN: '-1',
        type: '',
      };

      this.tableCols.unshift(row);
  }
   
      

  
  }
          
  
            this.tableData = res.data.Table;
           //将data 中的数据放到DataList中
           this.Search.total = res.data.Table1[0].RecordCount;
           this.setData(0);
            setTimeout(() => {
        this.setHeight();
      
      }, 1000);
        
        },setHeight() {
          
          this.ToolBarheight = this.$refs.headRef.offsetHeight+130;
          
       
      },    async setData(remarkTb) {

this.spread[0].suspendPaint();
let sheet = this.spread[0].getActiveSheet();



sheet.options.protectionOptions.allowSort = false;
sheet.options.protectionOptions.allowFilter = false;
//       sheet.options.allowCellOverflow = true;
sheet.defaults.rowHeight = 23;
sheet.defaults.colWidth = 100;
sheet.defaults.colHeaderRowHeight = 23;
sheet.defaults.rowHeaderColWidth = 60;
this.spread[remarkTb].options.tabStripVisible = false; //是否显示表单标签
let colHeader1 = [];
let colInfos = [];

sheet.setDataSource(this.tableData);



this.tableCols.forEach((x, y) => {

  x['name'] = x['prop'];
  x['displayName'] = x['label'];
  x['width'] = parseInt(x.width);
  if (x.prop === 'isChecked') {
    // 选框
    sheet.setCellType(
      0,
      0,
      new HeaderCheckBoxCellType(),
      GCsheets.SheetArea.colHeader,
    );
    x.cellType = new GC.Spread.Sheets.CellTypes.CheckBox();
  } else if (
    x.type === 'comboboxMultiple' ||
    x.type === 'combobox' || x.type === 'Select'
  ) {
    if (x.ValueMember) {

      let newData = []; // 设置列表每行下拉菜单
      x.ColsRowDate.map((item, index) => {

        let row = {
          text: item.label,
          value: item.value,
        };
        newData.push(row);


      });
      // newData.push(item.value);
      // y
      // x
      // this.tableCols
      // this.tableData
      // debugger
      this.tableData.forEach((x, y1) => {
        // 获取要绑定下拉菜单的单元格对象
        let cell = sheet.getCell(y1, y);
        // 创建下拉菜单单元格类型，并设置其选项数据
        let comboBox = new GC.Spread.Sheets.CellTypes.ComboBox();
        comboBox.editorValueType(
          GC.Spread.Sheets.CellTypes.EditorValueType.value,
        );
        comboBox.editable(true);
        // 获取下拉菜单的选项数据
        comboBox.items(newData);
        comboBox.itemHeight(24);
        // 将下拉菜单单元格类型绑定到指定的单元格中
        cell.cellType(comboBox);
        // debugger
      })
      // y
      // x
      // this.tableData
      // debugger
    }


  } else if (x.type === 'checkbox') {
    let cellType = new GC.Spread.Sheets.CellTypes.CheckBox();
    cellType.caption('');
    cellType.textTrue('');
    cellType.textFalse('');
    cellType.textIndeterminate('');
    cellType.textAlign(
      GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.center,
    );
    cellType.isThreeState(false);
    sheet.getCell(-1, y).cellType(cellType);
  } else if (
    x.type == 'datetime' ||
    x.type === 'varchar' ||
    x.type === 'nvarchar' || x.type === 'Input'
  ) {
    // const cell = sheet.getCell(-1, y);
    // cell.locked(false).foreColor('#2a06ecd9');
    // sheet.getRange(-1, y, 1, 1).locked(false);
    x.formatter = '@';
  }

  const cell = sheet.getCell(-1, y);
  cell.foreColor('black');
  //cell.backColor('white');
  if ((x.IsWrite == '1' && x.WFStepSN.indexOf(this.StepSN) > -1) || x.prop == 'isChecked') {
    cell.locked(false).foreColor('#2a06ecd9');
    //cell.backColor('#45b97c');

  } else if (x.prop != 'isChecked') {

  }

  sheet.options.protectionOptions.allowResizeColumns = true;
  sheet.options.isProtected = true;
  sheet.options.protectionOptions.allowResizeColumns = true;
  sheet.options.protectionOptions.allowInsertRows = true;
  sheet.options.protectionOptions.allowDeleteRows = true;
  sheet.options.protectionOptions.allowSelectLockedCells = true;
  sheet.options.protectionOptions.allowSelectUnlockedCells = true;
  sheet.options.protectionOptions.allowDeleteColumns = true;
  sheet.options.protectionOptions.allowInsertColumns = true;
  sheet.options.protectionOptions.allowDargInsertRows = true;
  sheet.options.protectionOptions.allowDragInsertColumns = true;
  sheet.options.protectionOptions.allowSort = true;
  sheet.options.protectionOptions.allowFilter = true;
  sheet.options.allowUserDragDrop = true;
  //行，start,end
  // if (x.isEdit) {
  //   sheet.getCell(-1, y).locked(false).foreColor("#2a06ecd9");
  // }

  // for (var i = 0; i < sheet.getRowCount(); i++) {

  //   const cell = sheet.getCell(i, y);
  //   cell.foreColor('black');
  // //cell.backColor('white');
  //   if(x.IsWrite == '1'&&x.WFStepSN.indexOf(this.StepSN)>-1)
  //   {
  //     cell.locked(false).foreColor('#2a06ecd9');

  //   }else if(x.prop!='isChecked')
  //   {

  //   }


  // }


}

);

sheet.bindColumns(this.tableCols); //此方法一定要放在setDataSource后面才能正确渲染列名
sheet.setRowCount(1, GC.Spread.Sheets.SheetArea.colHeader);
colHeader1.forEach(function (value, index) {
  sheet.setValue(0, index, value, GC.Spread.Sheets.SheetArea.colHeader);


});


/////////////////表格事件/////////////
//绑定表格事件前，需清除之前的绑定事件
this.spread[remarkTb].unbindAll();
this.spread[remarkTb].bind(GCsheets.Events.ButtonClicked, (e, args) => {
  const { sheet, row, col } = args;
  const cellType = sheet.getCellType(row, col);
  if (cellType instanceof GCsheets.CellTypes.Button) {
  }
  if (cellType instanceof GCsheets.CellTypes.CheckBox) {

    this.Indexs = row;


  }

  if (cellType instanceof GCsheets.CellTypes.HyperLink) {
  }
});

this.spread[0].options.allowContextMenu = true;
var insertRowsCopyStyle = {
  canUndo: true,
  name: 'insertRowsCopyStyle',
  execute: function (context, options, isUndo) {
    var Commands = GC.Spread.Sheets.Commands;
    if (isUndo) {
      Commands.undoTransaction(context, options);
      return true;
    } else {
      sheet.suspendPaint();
      sheet.addRows(options.activeRow, _this.sheetSelectRows.length);
      //  sheet.setArray(options.activeRow, 0,_this.sheetSelectRows);
      // console.log(_this.sheetSelectRows);

      // console.log(_this.sheetSelectObj.start+_this.sheetSelectRows.length)
      //删除旧行
      if (_this.sheetSelectObj.start > options.activeRow) {
        //说明从下面插入上面
        sheet.copyTo(
          _this.sheetSelectObj.start + _this.sheetSelectRows.length,
          0,
          options.activeRow,
          0,
          _this.sheetSelectRows.length,
          sheet.getColumnCount(),
          GC.Spread.Sheets.CopyToOptions.all,
        );

        //   sheet.setArray(options.activeRow, 0, _this.sheetSelectRows);
        sheet.deleteRows(
          _this.sheetSelectObj.start + _this.sheetSelectRows.length,
          _this.sheetSelectObj.count,
        );
        // sheet.removeRow(_this.sheetSelectObj.start+ _this.sheetSelectRows.length)
      } else {
        //从上面往下面插入
        sheet.copyTo(
          _this.sheetSelectObj.start,
          0,
          options.activeRow,
          0,
          _this.sheetSelectRows.length,
          sheet.getColumnCount(),
          GC.Spread.Sheets.CopyToOptions.all,
        );
        //  sheet.setArray(options.activeRow, 0, _this.sheetSelectRows);
        sheet.deleteRows(
          _this.sheetSelectObj.start,
          _this.sheetSelectObj.count,
        );
      }
      let count = sheet.getRowCount(GC.Spread.Sheets.SheetArea.viewport);

      let lineID = _this.sheetSelectRows[0][lineIDIndex];
      let isFind = false;
      let viewSort = 1;

      for (var i = 0; i < count; i++) {
        if (isFind == false && sheet.getValue(i, lineIDIndex) == lineID) {
          isFind = true;
        }
        if (isFind && sheet.getValue(i, lineIDIndex) != lineID) {
          break;
        }
        if (isFind) {
          sheet.setValue(i, viewSortIndex, viewSort);
          viewSort++;
        }
      }

      // Commands.startTransaction(context, options);

      sheet.suspendPaint();

      // var beforeRowCount = 0;

      //  sheet.suspendPaint();

      // Commands.endTransaction(context, options);
      sheet.resumePaint();

      return true;
    }
  },
};

this.spread[remarkTb]
  .commandManager()
  .register('insertRowsCopyStyle', insertRowsCopyStyle);

function MyContextMenu() { }
MyContextMenu.prototype = new GC.Spread.Sheets.ContextMenu.ContextMenu(
  this.spread[remarkTb],
);
MyContextMenu.prototype.onOpenMenu = function (
  menuData,
  itemsDataForShown,
  hitInfo,
  spread,
) {
  itemsDataForShown.forEach(function (item, index) {
    // console.log(item);
    if (item && item.name === 'gc.spread.rowHeaderinsertCutCells') {
      item.command = 'insertRowsCopyStyle';
    }
    //  else if (item && item.name === "gc.spread.cut") {

    //     item.command = "insertRowsCut";
    //   }
  });
};
var contextMenu = new MyContextMenu();
this.spread[remarkTb].contextMenu = contextMenu;


// 列筛选
// 参数2 开始列
// 参数3
// 参数4 结束列
let cellrange = new GC.Spread.Sheets.Range(
  -1,
  -1,
  -1,
  this.tableCols.length,
);
let hideRowFilter = new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
sheet.rowFilter(hideRowFilter);


sheet.resumePaint();


}, getSelectionData() {
let sheet = this.spread.getActiveSheet();
let newData = sheet.getDataSource();
this.selectionData[0] = [];
if (newData.length != 0) {
  newData.forEach((x) => {
    if (x.isChecked) {
      this.selectionData[0].push(x);
    }
  });
}
}, //获取当前选中行的值
selectChanged(newValue, remarkTb) {
// 在子组件计算属性发生变化时，更新父组件的计算属性
// debugger
this.selectionData = newValue;


let sheet = this.spread[0].getActiveSheet()
let set = sheet.getSelections()[0].row

let flag = false
this.selectedRowIndexSave.forEach((v, i) => {
  if (v == set) {
    this.selectedRowIndexSave.splice(i, 1)
    flag = true;
  }
})
if (!flag) this.selectedRowIndexSave.push(set)
if (this.bit) {
  this.selectedRowIndexSave.pop()
  this.bit = false
}
// this.selectedRowIndexSave
// debugger
},OpenFindForm() {
          //打开搜索框
          this.SearchDialog = true;
          //计算外边距
          console.log(this.$refs.searchDialog.offsetHeight);
          this.DialogBtnMargin = this.$refs.searchDialog.offsetHeight - 40;
        },async handlexportData() {
          this.Search.Download="1";
          const res = await getfunDownload({ data: JSON.stringify(this.Search) });
          this.Search.Download="0";
          funDownloadv1(res); //更改
        }, handleIsfunEdit() {
          this.IsfunEdit=true;
        }, handleIsfunfail() {
           this.Isfunfail=true;
        },async handeAdd() {
          // 新建
    
  
    const result = await UpdateForm({ IsPostBack:false,InterID:this.InterID});
     this.FormData=result.data1.Table[0];
     this.billIDName=result.billIDName;
     this.dialogType = 'edit'
        this.dialogVisible = true
        this.checkStrictly = true
      
        this.$nextTick(() => {
          const routes = this.generateRoutes(this.EditObj.routes)
          this.$refs.tree.setCheckedNodes(this.generateArr(routes))
          // set checked state of a node not affects its father and child nodes
          this.checkStrictly = false
  
        })
        this.getDataList();
  
          // let routeUrl = this.$router.push({
          //   path: "/MesPieceWork/CompleteProcedureRoportForm",//更改
          //   query: { billID: "", IsPostBack: false },
          // });
          // window.open(routeUrl.path, "_top");
        
        },
       async handleEdit(scope) {
          // 修改
    
          //  let routeUrl = this.$router.push({
          //   path: "/MesPieceWork/CompleteProcedureRoportForm",//更改
          //   query: { billID: scope.row.billID, IsPostBack: false },
          // });
          // window.open(routeUrl.href, "_top");
    
          // this.inputName = row.billID;
  
          const result = await UpdateForm({ IsPostBack:false,InterID:this.InterID,SavaDate:JSON.stringify(scope.row)});
         this.FormData=result.data1.Table[0];
         this.billIDName=result.billIDName;
        this.dialogType = 'edit'
        this.dialogVisible = true
        this.checkStrictly = true
      
        this.$nextTick(() => {
          const routes = this.generateRoutes(this.EditObj.routes)
          this.$refs.tree.setCheckedNodes(this.generateArr(routes))
          // set checked state of a node not affects its father and child nodes
          this.checkStrictly = false
  
        })
        this.getDataList();
       
          
        },async handleSave() {
      // 修改
      
    const result = await UpdateForm({ IsPostBack:true,InterID:this.InterID,SavaDate:JSON.stringify(this.FormData)});
     this.FormData=result.data1.Table[0];
     this.billIDName=result.billIDName;
        if (result.code === 20000) {
         
       
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "success",
          });
          this.getDataList();
        } else {
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "error",
          });
        }
      
       
        this.getDataList();
      
    }, async handleAllSave(scope) {
      // 修改
debugger
      const result = await SaveData({ InterID: this.InterID, BodyDate: JSON.stringify(this.tableData) });

      if (result.code === 20000) {


        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "success",
        });
        this.getDataList();
      } else {
        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "error",
        });
      }
      this.getDataList();

    },delData() {
         this.$confirm('删除操作, 是否继续?', '提示', {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
          })
            .then(async () => {
             
                this.spread[0].suspendPaint();
          let sheet = this.spread[0].getActiveSheet();
          sheet.deleteRows(this.Indexs, 1);
          sheet.resumePaint()
          // debugger
          for (var row of this.selectionData) {

    
                const result = await DeleteForm({
                  InterID:this.InterID,
                  SavaDate: JSON.stringify(row),
                  IsPostBack: false,
                });

            }
    this.getDataList();
                this.$message({
                  type: "success",
                  message: result.msg,
                });
              
            })
            .catch((err) => {
              console.error(err);
            });
        },  FunrRowsAdd() {
      // debugger
      let row = {
        IDXNO: null,
        NAME: null,
        IDXUP: null,
        LB: null,
        ID: null,

      };

      // this.tableData.push(row);

      this.spread[0].suspendPaint();
      let sheet = this.spread[0].getActiveSheet();
      let count = sheet.getRowCount(GC.Spread.Sheets.SheetArea.viewport);
      sheet.addRows(count + 1, 1);
      //sheet.suspendPaint()

      sheet.resumePaint()





    },handrowclick(row)
        {
    
           
             this.billID=row.billID;
    
        },handleOpenClose()
    {
        this.dialogVisible = false
    },handleclose() {
    
    
        if(this.billID!="")
        {
    
     this.$confirm('关单操作, 是否继续? 订单号：'+this.billID, '提示', {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
          })
            .then(async () => {
             
               
    
                const result = await CloseForm({
    
                  billID: this.billID,
                  types: 1,
                  IsPostBack: false,
                });
    this.getDataList();
                this.$message({
                  type: "success",
                  message: result.msg,
                });
              
            })
            .catch((err) => {
              console.error(err);
            });
        }else
        {
           this.$notify({
                title: "关单操作，请选择数据"+this.billID,
                dangerouslyUseHTMLString: true,
                message: "",
                type: "error",
              });
        }
    
    
        
        },
         
           
      }
    }
    </script>
    
    <style lang="scss" scoped>
    
    .app-container {
      .EditObjs-table {
        margin-top: 30px;
      }
    
      .permission-tree {
        margin-bottom: 5px;
      }
    }
    .searchDialog ::v-deep .el-dialog__header {
      background: #409eff;
    }
    .searchDialog ::v-deep .el-dialog__title {
      color: #fff;
    }
    .searchDialog ::v-deep .el-dialog__headerbtn .el-dialog__close {
      color: #fff;
    }
    </style>